* define interaction terms -----------------------------------------------------

gen single_ad = treatment * akp_district
gen multi_ad = treatment_multi * akp_district

* label the terms --------------------------------------------------------------

label variable single_ad           "Treatment X AKP District"
label variable multi_ad            "Multiple Treatment X AKP District"

* run the regressions models and save them to memory ---------------------------

eststo: reg akp_nov treatment single_ad akp_jun recruitment_pool akp_district,  ///
cluster(province)

eststo: reg akp_nov treatment single_ad akp_jun recruitment_pool                ///
treatment_nonterror casualty_district kurdish_district akp_district             ///
higher_education min_margin turnout_jun, cluster(province)

eststo: reg akp_nov treatment treatment_multi multi_ad akp_jun  akp_district    ///
recruitment_pool, cluster(province)

eststo: reg akp_nov treatment treatment_multi multi_ad akp_jun recruitment_pool ///
treatment_nonterror casualty_district kurdish_district akp_district             ///
higher_education min_margin turnout_jun, cluster(province)

* print the results ------------------------------------------------------------

esttab,                                                                         ///
replace se b(3) se(3) stats(N vce r2) label nodepvars nonotes nomtitles         ///
order(treatment treatment_multi single_ad multi_ad akp_jun recruitment_pool     ///
treatment_nonterror casualty_district kurdish_district akp_district)            ///
substitute(vce "Clusters" cluster "81")                                         ///
title("Table S12: Regression models with interaction terms, constructed with AKP District")

* save the results -------------------------------------------------------------

esttab using "./tables/table_s12.tex",                                          ///
replace se b(3) se(3) stats(N vce r2) label nodepvars nonotes nomtitles         ///
order(treatment treatment_multi single_ad multi_ad akp_jun recruitment_pool     ///
treatment_nonterror casualty_district kurdish_district akp_district)            ///
substitute(vce "Clusters" cluster "81")                                         ///
title("Regression models with interaction terms, constructed with \textit{AKP District}")

* remove the interaction variables ---------------------------------------------

drop single_ad multi_ad

* remove the models from memory ------------------------------------------------

eststo clear